# 数据list 切片操作
list1 = [1,2, 3, 4, 5,6, 7, 8, 9,10]
print(list1[0:3])
print(list1[1:])
print(list1[1:3])
# 元组的操作
tuple1 = (1,2, 3, 4, 5,6, 7, 8, 9,10)
print(tuple1[0:3])
print(tuple1[1:])
print(tuple1[1:3])
# 字符串的操作
string1 = "hello world"
print(string1[0:5])
print(string1[1:])
print(string1[1:5])
# 列表的嵌套
list2 = [1,2, [3,4,5], 6, 7, [8,9,10]]
print(list2[2][1])   # 输出 4
print(list2[5][1])   # 输出 9

# 字典的操作
dict1 = {'name': 'Alice', 'age': 20, 'city': 'Beijing'}
print(dict1['name'])
print(dict1['age'])
print(dict1['city'])
print(dict1.keys())
print(dict1.values())